<?php

require_once '/usr/share/php/symfony/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

function pa($value = 'hello', $options = array()) { // Debug
  $args = func_get_args();
  return call_user_func_array(array('wgHelper','pa'),$args);
}

function bt($level = 1, $options = array()) {
  $backtrace = debug_backtrace();
  $offset = 0;
  $length = count($backtrace);
  if (is_numeric($level)) {
    $offset = $level;
    $length = 1;
  } else {
  	$splinters = explode('-', $level);
  	if (count($splinters) == 2) {
  		$offset = $splinters[0];
  		$length = $splinters[1] - $offset;
  	}
  }
  $backtrace = array_slice($backtrace, $offset, $length);
  $properties = array('file', 'line', 'function', 'class');
  $inspectors = array();
  foreach ($backtrace as $backtrace) {
	  $inspector = array();
	  foreach ($properties as $property) {
	    $inspector[$property] = isset($backtrace[$property])? $backtrace[$property] : 'null';
	  }
	  $inspectors[] = $inspector;
  }
  if (count($inspectors) == 1) {
    $inspectors = $inspectors[0];
  }
  return empty($options['echo'])? pa($inspectors, $options) : print_r($inspectors);
}

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    // for compatibility / remove and enable only the plugins you want
    $this->enableAllPluginsExcept(array('sfDoctrinePlugin', 'sfCompat10Plugin'));
  }
}
